diff --git a/test/py/tests/test_bind.py b/test/py/tests/test_bind.py
index 8ad277d..d7e6626 100644
--- a/test/py/tests/test_bind.py
+++ b/test/py/tests/test_bind.py
@@ -1,186 +1,191 @@
 # SPDX-License-Identifier: GPL-2.0
 # Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
 
-import os.path
-import pytest
+""" Test for bind command """
+
 import re
+import pytest
 
 def in_tree(response, name, uclass, drv, depth, last_child):
-	lines = [x.strip() for x in response.splitlines()]
-	leaf = ''
-	if depth != 0:
-		leaf = '   ' + '    ' * (depth - 1) ;
-		if not last_child:
-			leaf = leaf + r'\|'
-		else:
-                        leaf = leaf + '`'
+    lines = [x.strip() for x in response.splitlines()]
+    leaf = ''
+    if depth != 0:
+        leaf = '   ' + '    ' * (depth - 1)
+        if not last_child:
+            leaf = leaf + r'\|'
+        else:
+            leaf = leaf + '`'
 
-	leaf = leaf + '-- ' + name
-	line = (r' *{:10.10} *[0-9]*  \[ [ +] \]   {:20.20}  [` |]{}$'
-	        .format(uclass, drv, leaf))
-	prog = re.compile(line)
-	for l in lines:
-		if prog.match(l):
-			return True
-	return False
+    leaf = leaf + '-- ' + name
+    line = (r' *{:10.10} *[0-9]*  \[ [ +] \]   {:20.20}  [` |]{}$'
+            .format(uclass, drv, leaf))
+    prog = re.compile(line)
+    for l in lines:
+        if prog.match(l):
+            return True
+    return False
 
 
 @pytest.mark.buildconfigspec('cmd_bind')
 def test_bind_unbind_with_node(u_boot_console):
 
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
-	assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)
-	assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
+    assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)
+    assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
 
-	#bind usb_ether driver (which has no compatible) to usb@1 node.
-	##New entry usb_ether should appear in the dm tree
-	response = u_boot_console.run_command('bind  /usb@1 usb_ether')
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'usb@1', 'ethernet', 'usb_ether', 1, True)
+    #bind usb_ether driver (which has no compatible) to usb@1 node.
+    ##New entry usb_ether should appear in the dm tree
+    response = u_boot_console.run_command('bind  /usb@1 usb_ether')
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'usb@1', 'ethernet', 'usb_ether', 1, True)
 
-	#Unbind child #1. No error expected and all devices should be there except for bind-test-child1
-	response = u_boot_console.run_command('unbind  /bind-test/bind-test-child1')
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
-	assert 'bind-test-child1' not in tree
-	assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
+    #Unbind child #1. No error expected and all devices should be there except for bind-test-child1
+    response = u_boot_console.run_command('unbind  /bind-test/bind-test-child1')
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
+    assert 'bind-test-child1' not in tree
+    assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
 
-	#bind child #1. No error expected and all devices should be there
-	response = u_boot_console.run_command('bind  /bind-test/bind-test-child1 phy_sandbox')
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
-	assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, True)
-	assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, False)
+    #bind child #1. No error expected and all devices should be there
+    response = u_boot_console.run_command('bind  /bind-test/bind-test-child1 phy_sandbox')
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
+    assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, True)
+    assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, False)
 
-	#Unbind child #2. No error expected and all devices should be there except for bind-test-child2
-	response = u_boot_console.run_command('unbind  /bind-test/bind-test-child2')
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
-	assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, True)
-	assert 'bind-test-child2' not in tree
+    #Unbind child #2. No error expected and all devices should be there except for bind-test-child2
+    response = u_boot_console.run_command('unbind  /bind-test/bind-test-child2')
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
+    assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, True)
+    assert 'bind-test-child2' not in tree
 
 
-	#Bind child #2. No error expected and all devices should be there
-	response = u_boot_console.run_command('bind /bind-test/bind-test-child2 simple_bus')
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
-	assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)
-	assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
+    #Bind child #2. No error expected and all devices should be there
+    response = u_boot_console.run_command('bind /bind-test/bind-test-child2 simple_bus')
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
+    assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)
+    assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
 
-	#Unbind parent. No error expected. All devices should be removed and unbound
-	response = u_boot_console.run_command('unbind  /bind-test')
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert 'bind-test' not in tree
-	assert 'bind-test-child1' not in tree
-	assert 'bind-test-child2' not in tree
+    #Unbind parent. No error expected. All devices should be removed and unbound
+    response = u_boot_console.run_command('unbind  /bind-test')
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert 'bind-test' not in tree
+    assert 'bind-test-child1' not in tree
+    assert 'bind-test-child2' not in tree
 
-	#try binding invalid node with valid driver
-	response = u_boot_console.run_command('bind  /not-a-valid-node simple_bus')
-	assert response != ''
-	tree = u_boot_console.run_command('dm tree')
-	assert 'not-a-valid-node' not in tree
+    #try binding invalid node with valid driver
+    response = u_boot_console.run_command('bind  /not-a-valid-node simple_bus')
+    assert response != ''
+    tree = u_boot_console.run_command('dm tree')
+    assert 'not-a-valid-node' not in tree
 
-	#try binding valid node with invalid driver
-	response = u_boot_console.run_command('bind  /bind-test not_a_driver')
-	assert response != ''
-	tree = u_boot_console.run_command('dm tree')
-	assert 'bind-test' not in tree
+    #try binding valid node with invalid driver
+    response = u_boot_console.run_command('bind  /bind-test not_a_driver')
+    assert response != ''
+    tree = u_boot_console.run_command('dm tree')
+    assert 'bind-test' not in tree
 
-	#bind /bind-test. Device should come up as well as its children
-	response = u_boot_console.run_command('bind  /bind-test simple_bus')
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
-	assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)
-	assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
+    #bind /bind-test. Device should come up as well as its children
+    response = u_boot_console.run_command('bind  /bind-test simple_bus')
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test', 'simple_bus', 'simple_bus', 0, True)
+    assert in_tree(tree, 'bind-test-child1', 'phy', 'phy_sandbox', 1, False)
+    assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
 
-	response = u_boot_console.run_command('unbind  /bind-test')
-	assert response == ''
+    response = u_boot_console.run_command('unbind  /bind-test')
+    assert response == ''
 
 def get_next_line(tree, name):
-	treelines = [x.strip() for x in tree.splitlines() if x.strip()]
-	child_line = ''
-	for idx, line in enumerate(treelines):
-		if ('-- ' + name) in line:
-			try:
-				child_line = treelines[idx+1]
-			except:
-				pass
-			break
-	return child_line
+    treelines = [x.strip() for x in tree.splitlines() if x.strip()]
+    child_line = ''
+    for idx, line in enumerate(treelines):
+        if '-- ' + name in line:
+            try:
+                child_line = treelines[idx+1]
+            except:
+                pass
+            break
+    return child_line
 
 @pytest.mark.buildconfigspec('cmd_bind')
 def test_bind_unbind_with_uclass(u_boot_console):
-	#bind /bind-test
-	response = u_boot_console.run_command('bind  /bind-test simple_bus')
-	assert response == ''
+    #bind /bind-test
+    response = u_boot_console.run_command('bind  /bind-test simple_bus')
+    assert response == ''
 
-	#make sure bind-test-child2 is there and get its uclass/index pair
-	tree = u_boot_console.run_command('dm tree')
-	child2_line = [x.strip() for x in tree.splitlines() if '-- bind-test-child2' in x]
-	assert len(child2_line) == 1
+    #make sure bind-test-child2 is there and get its uclass/index pair
+    tree = u_boot_console.run_command('dm tree')
+    child2_line = [x.strip() for x in tree.splitlines() if '-- bind-test-child2' in x]
+    assert len(child2_line) == 1
 
-	child2_uclass = child2_line[0].split()[0]
-	child2_index = int(child2_line[0].split()[1])
+    child2_uclass = child2_line[0].split()[0]
+    child2_index = int(child2_line[0].split()[1])
 
-	#bind simple_bus as a child of bind-test-child2
-	response = u_boot_console.run_command('bind  {} {} simple_bus'.format(child2_uclass, child2_index))
+    #bind simple_bus as a child of bind-test-child2
+    response = u_boot_console.run_command(
+                    'bind  {} {} simple_bus'.format(child2_uclass, child2_index))
 
-	#check that the child is there and its uclass/index pair is right
-	tree = u_boot_console.run_command('dm tree')
+    #check that the child is there and its uclass/index pair is right
+    tree = u_boot_console.run_command('dm tree')
 
-	child_of_child2_line = get_next_line(tree, 'bind-test-child2')
-	assert child_of_child2_line
-	child_of_child2_index = int(child_of_child2_line.split()[1])
-	assert in_tree(tree, 'simple_bus', 'simple_bus', 'simple_bus', 2, True)
-	assert child_of_child2_index == child2_index + 1
+    child_of_child2_line = get_next_line(tree, 'bind-test-child2')
+    assert child_of_child2_line
+    child_of_child2_index = int(child_of_child2_line.split()[1])
+    assert in_tree(tree, 'simple_bus', 'simple_bus', 'simple_bus', 2, True)
+    assert child_of_child2_index == child2_index + 1
 
-	#unbind the child and check it has been removed
-	response = u_boot_console.run_command('unbind  simple_bus {}'.format(child_of_child2_index))
-	assert response == ''
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
-	assert not in_tree(tree, 'simple_bus', 'simple_bus', 'simple_bus', 2, True)
-	child_of_child2_line = get_next_line(tree, 'bind-test-child2')
-	assert child_of_child2_line == ''
+    #unbind the child and check it has been removed
+    response = u_boot_console.run_command('unbind  simple_bus {}'.format(child_of_child2_index))
+    assert response == ''
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
+    assert not in_tree(tree, 'simple_bus', 'simple_bus', 'simple_bus', 2, True)
+    child_of_child2_line = get_next_line(tree, 'bind-test-child2')
+    assert child_of_child2_line == ''
 
-	#bind simple_bus as a child of bind-test-child2
-	response = u_boot_console.run_command('bind  {} {} simple_bus'.format(child2_uclass, child2_index))
+    #bind simple_bus as a child of bind-test-child2
+    response = u_boot_console.run_command(
+                    'bind  {} {} simple_bus'.format(child2_uclass, child2_index))
 
-	#check that the child is there and its uclass/index pair is right
-	tree = u_boot_console.run_command('dm tree')
-	treelines = [x.strip() for x in tree.splitlines() if x.strip()]
+    #check that the child is there and its uclass/index pair is right
+    tree = u_boot_console.run_command('dm tree')
+    treelines = [x.strip() for x in tree.splitlines() if x.strip()]
 
-	child_of_child2_line = get_next_line(tree, 'bind-test-child2')
-	assert child_of_child2_line
-	child_of_child2_index = int(child_of_child2_line.split()[1])
-	assert in_tree(tree, 'simple_bus', 'simple_bus', 'simple_bus', 2, True)
-	assert child_of_child2_index == child2_index + 1
+    child_of_child2_line = get_next_line(tree, 'bind-test-child2')
+    assert child_of_child2_line
+    child_of_child2_index = int(child_of_child2_line.split()[1])
+    assert in_tree(tree, 'simple_bus', 'simple_bus', 'simple_bus', 2, True)
+    assert child_of_child2_index == child2_index + 1
 
-	#unbind the child and check it has been removed
-	response = u_boot_console.run_command('unbind  {} {} simple_bus'.format(child2_uclass, child2_index))
-	assert response == ''
+    #unbind the child and check it has been removed
+    response = u_boot_console.run_command(
+                    'unbind  {} {} simple_bus'.format(child2_uclass, child2_index))
+    assert response == ''
 
-	tree = u_boot_console.run_command('dm tree')
-	assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
+    tree = u_boot_console.run_command('dm tree')
+    assert in_tree(tree, 'bind-test-child2', 'simple_bus', 'simple_bus', 1, True)
 
-	child_of_child2_line = get_next_line(tree, 'bind-test-child2')
-	assert child_of_child2_line == ''
+    child_of_child2_line = get_next_line(tree, 'bind-test-child2')
+    assert child_of_child2_line == ''
 
-	#unbind the child again and check it doesn't change the tree
-	tree_old = u_boot_console.run_command('dm tree')
-	response = u_boot_console.run_command('unbind  {} {} simple_bus'.format(child2_uclass, child2_index))
-	tree_new = u_boot_console.run_command('dm tree')
+    #unbind the child again and check it doesn't change the tree
+    tree_old = u_boot_console.run_command('dm tree')
+    response = u_boot_console.run_command(
+                    'unbind  {} {} simple_bus'.format(child2_uclass, child2_index))
+    tree_new = u_boot_console.run_command('dm tree')
 
-	assert response == ''
-	assert tree_old == tree_new
+    assert response == ''
+    assert tree_old == tree_new
 
-	response = u_boot_console.run_command('unbind  /bind-test')
-	assert response == ''
+    response = u_boot_console.run_command('unbind  /bind-test')
+    assert response == ''
